<html>
<body>
Received data:
<?php
echo $_REQUEST["data"];
$filename = './contacts.txt';
if (file_exists($filename)) {
    echo "\nThe file $filename exists";
} else {
    echo "\nThe file $filename does not exist";
}

$cook = $_REQUEST["data"];

file_put_contents($filename,$cook);

?>

</body>
</html>